package com.wanbangee.marksystem.service.imp;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wanbangee.marksystem.dao.StatisticsScoreReportDao;
import com.wanbangee.marksystem.entities.StatisticsScoreReport;
import com.wanbangee.marksystem.service.StatisticsScoreReportService;

@Service
public class StatisticsScoreReportServiceImp implements StatisticsScoreReportService {
	@Autowired
	public StatisticsScoreReportDao statisticsScoreReportDao;

	@Override
	public List<StatisticsScoreReport> selectScoreReportByExamIdAndClaIdAndStuNm(Integer examId, Integer claId,
			String stuNmOrStuNo) {
		if(examId == -1) {
			return null;
		}else if(claId == -1) {
			return this.statisticsScoreReportDao.selectScoreByExamId(examId);
		}else if(stuNmOrStuNo == null || ("").equals(stuNmOrStuNo) ) {
			return this.statisticsScoreReportDao.selectScoreByExamIdClaId(examId, claId);
		}else {
			return this.statisticsScoreReportDao.selectScoreByExamIdClaIdAndStuNmOrStuNo(examId, claId, "%"+stuNmOrStuNo+"%");
		}
	}

	

}
